Skip to content

chore: update relayer-sdk to 0.4.1 and fix browser mock mode - #43

Merged
poppyseedDev merged 4 commits into
mainfrom
update-relayer
Feb 24, 2026
Merged

chore: update relayer-sdk to 0.4.1 and fix browser mock mode#43
poppyseedDev merged 4 commits into
mainfrom
update-relayer

Conversation

@poppyseedDev

Copy link
Copy Markdown
Contributor

Summary

  • Update @zama-fhe/relayer-sdk to v0.4.1, @fhevm/solidity to v0.11.1, @fhevm/hardhat-plugin and @fhevm/mock-utils to v0.4.2
  • Fix hardhat chain missing from wagmi config so network switching works
  • Enable fhevm mock mode in the browser for hardhat localhost by shimming Node.js fs module (synchronous XHR for WASM loading) and patching node-tkms to use globalThis.TextEncoder/TextDecoder instead of require('util')
  • Serve kms_lib_bg.wasm and tfhe_bg.wasm from public/ for browser-side WASM loading
  • Update CDN URL to relayer-sdk 0.4.1

Test plan

  • pnpm install runs cleanly (postinstall patches node-tkms)
  • pnpm compile and pnpm hardhat:test pass
  • pnpm next:build succeeds
  • Start local hardhat node, deploy contracts, switch to hardhat in frontend — FHEVM instance connects in mock mode
  • Encrypt/decrypt operations work on hardhat localhost
  • Sepolia mode still works via CDN relayer SDK

🤖 Generated with Claude Code

poppyseedDev and others added 4 commits February 23, 2026 16:10
- @zama-fhe/relayer-sdk → 0.4.1 (all packages)
- @fhevm/solidity → ^0.11.1
- @fhevm/hardhat-plugin → ^0.4.2
- @fhevm/mock-utils → ^0.4.2
- ethers → ^6.16.0 (peer dep requirement)
- @nomicfoundation/hardhat-ethers → ^3.1.3 (peer dep requirement)
- Add turbopack resolveAlias for Node.js built-ins (fixes node-tkms fs error)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The wagmi config only included sepolia, so useSwitchChain had no
hardhat chain to switch to. Now both chains and transports are
always configured (hardhat transport is harmless in production).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Update relayer-sdk CDN URL to 0.4.1 in layout.tsx and constants.ts
- Replace empty-module.js with browser-compatible fs shim that loads
  WASM files via synchronous XHR from public/
- Copy node-tkms kms_lib_bg.wasm to public/ so the fs shim can serve it
- This allows @fhevm/mock-utils to run in the browser, enabling local
  encrypt/decrypt on hardhat without routing through the remote relayer

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Fix synchronous XHR binary loading using overrideMimeType instead of
  responseType (which is not supported for sync XHR)
- Add tfhe_bg.wasm to public/ for browser serving
- Patch node-tkms postinstall to use globalThis.TextEncoder/TextDecoder
  instead of require('util') (avoids breaking Privy's isKeyObject)
- Use empty-module.js fs shim in webpack fallback for production builds

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@vercel

vercel Bot commented Feb 24, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
dapps Ready Ready Preview, Comment Feb 24, 2026 11:19am

Request Review

@poppyseedDev
poppyseedDev merged commit 261f8ef into main Feb 24, 2026
6 checks passed
@poppyseedDev
poppyseedDev deleted the update-relayer branch February 24, 2026 11:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant